package huixue.cn.com.rxapp.rx;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import huixue.cn.com.library.widget.BaseRecycleView;
import huixue.cn.com.rxapp.R;
import huixue.cn.com.rxapp.base.SimpleActivity;
import huixue.cn.com.rxapp.rx.adapter.NormalAdapter;
import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator;

public class RecycleViewTestActivity extends SimpleActivity {

    @BindView(R.id.rcv_list_data)
    BaseRecycleView mRecyclerView;

    private List<String> datas;

    private NormalAdapter adapter;
    @Override
    public int getLayout() {
        return R.layout.activity_recycle_view_test;
    }

    @Override
    public void initView() {
        datas = new ArrayList<>();
        datas.add("刘一");
        datas.add("陈二");
        datas.add("张三");
        datas.add("李四");
        datas.add("王五");
        datas.add("赵六");
        datas.add("孙七");
        datas.add("周八");
        datas.add("吴九");
        datas.add("郑十");
        datas.add("王五");
        datas.add("赵六");
        datas.add("孙七");
        datas.add("周八");
        datas.add("吴九");
        datas.add("郑十");
        RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL, false);
        mRecyclerView.setLayoutManager(layoutManager);

        View footer = LayoutInflater.from(this).inflate(R.layout.layout_footer, mRecyclerView, false);
        View header = LayoutInflater.from(this).inflate(R.layout.layout_header, mRecyclerView, false);
        View empty = LayoutInflater.from(this).inflate(R.layout.layout_empty, mRecyclerView, false);
        adapter = new NormalAdapter(this,datas);
        mRecyclerView.setAdapter(adapter);
        mRecyclerView.setItemAnimator(new SlideInLeftAnimator());

        mRecyclerView.addHeaderView(header);
        mRecyclerView.addFooterView(footer);
        mRecyclerView.setEmptyView(empty);

    }

    @Override
    public void addEvent() {

    }


}
